package thread.sync.lock;

public class SimpleCounter implements Runnable{
	private int v = 0;
	int count = 0;
	
	@Override
	public void run() {
		
		increment();
		decrement();
		
		if (v != 0){
			count++;
		}
	}
    public void increment() {
    	for (int i=0; i < 1000000; i++){
    		v++;
    	}
    }

    public void decrement() {
    	for (int i=0; i < 1000000; i++){
    		v--;
    	}
    }
}
